using System;
using System.Collections.Generic;
using System.Text;

namespace Toenda.Foundation.PluginBase {
	/// <summary>
	/// Implements a ComponentNotFound exception
	/// </summary>
	public class ComponentNotFoundException : ComponentException {
		private string _componentName = "";

		/// <summary>
		/// Creates a new instance of <see cref="ComponentNotFoundException"/>
		/// </summary>
		/// <param name="componentName">The name of the component</param>
		public ComponentNotFoundException(string componentName)
			: base("The Component [" + componentName + "] could not be found.") {
			this._componentName = componentName;
		}

		/// <summary>
		/// Creates a new instance of <see cref="ComponentNotFoundException"/>
		/// </summary>
		/// <param name="componentName">The name of the component</param>
		/// <param name="message">Spezifies a own message</param>
		public ComponentNotFoundException(string componentName, string message)
			: base(message) {
			this._componentName = componentName;
		}

		/// <summary>
		/// Creates a new instance of <see cref="ComponentNotFoundException"/>
		/// </summary>
		/// <param name="componentName">The name of the component</param>
		/// <param name="message">Spezifies a own message</param>
		/// <param name="innerException">The innerException is a exception contained in this exception</param>
		public ComponentNotFoundException(string componentName, string message, Exception innerException)
			: base(message, innerException) {
			this._componentName = componentName;
		}

		/// <summary>
		/// Gets the name of the component that was not found
		/// </summary>
		public string ComponentName {
			get { return this._componentName; }
		}
	}
}
